Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch failed http requests that didn't error so we can handle them correctly #847

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

boatbomber
Copy link
Member

The http.get promise treated any request that made it through the pcall without erroring as a success to resolve.
ApiContext would then check the status code and reject, but by then it's too late to handle gracefully and we just show the error code and stop the sync.

This improves that. We create a relevant Error object for requests that are not success codes, so that ApiContext can handle them correctly.

The immediate impact is that GitHub Codespaces is now compatible with Rojo, since requests to the forwarded port receive a 504 Gateway Timeout after 100 seconds. Given our long polling, we simply resend requests that return a timeout.

@boatbomber boatbomber added type: enhancement Feature or improvement that should potentially happen scope: plugin Relevant to the Roblox Studio plugin labels Feb 1, 2024
@boatbomber boatbomber requested a review from Dekkonot February 1, 2024 11:41
@boatbomber boatbomber self-assigned this Feb 1, 2024
@boatbomber boatbomber changed the title Catch http codes that indicate failure without erroring Catch failed http requests that didn't error so we can handle them correctly Feb 1, 2024
CHANGELOG.md Show resolved Hide resolved
Dekkonot
Dekkonot approved these changes Feb 1, 2024
@Dekkonot Dekkonot enabled auto-merge (squash) February 1, 2024 21:28
@Dekkonot Dekkonot merged commit 5c4260f into rojo-rbx:master Feb 1, 2024
6 checks passed
@boatbomber boatbomber deleted the catch-http-codes branch February 1, 2024 21:46
kennethloeffler pushed a commit to kennethloeffler/rojo that referenced this pull request Feb 2, 2024
Dekkonot pushed a commit that referenced this pull request Feb 4, 2024
This PR adds a fix for gateway timeout handling to the 7.4.x branch

Co-authored-by: boatbomber <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: plugin Relevant to the Roblox Studio plugin type: enhancement Feature or improvement that should potentially happen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants